#include "main_plane.h"
#include "config.h"
#include "QSize"

main_plane::main_plane()
    : plane(MAIN_ICON)
{
    plane = plane.scaled(48,48,Qt::KeepAspectRatio);
    m_speed = 20;
    m_x = (GAME_WINDOW_WIDE - plane.width())/2;
    m_y = (GAME_WINDOW_HIGH - plane.height());

    plane_rect.setWidth(plane.width());
    plane_rect.setHeight(plane.height());
    plane_rect.moveTo(m_x,m_y);

    bl_m1_num = 100;

    life = 10;
}

void main_plane::get_bullet(int num)
{
    bl_m1_num += num;
}

void main_plane::shoot()
{
    if(bl_m1_num == 0) return;
    bl_m1_num--;
    bullet_m1 *temp = new bullet_m1;
    temp->m_x = m_x+plane.width()/2;
    temp->m_y = m_y;
    list_bl.push_back(temp);
}
